
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>List</title>
</head>
<body>

    <form method="post" action="">
        <input type="hidden" name="_method" value="DELETE">
    </form>

    <c:if test="${empty requestScope.all}">没有用户</c:if>
    <c:if test="${!empty requestScope.all}">
        <table border="1">
            <tr>
                <th>Id</th>
                <th>LastName</th>
                <th>Email</th>
                <th>Fender</th>
                <th>Option</th>
            </tr>

                <c:forEach items="${requestScope.all}" var="entity">
                    <tr>
                        <td>${entity.id}</td>
                        <td>${entity.lastName}</td>
                        <td>${entity.email}</td>
                        <td>${entity.fender}</td>
                        <td><a href="#">Edit</a> &nbsp; <a class="delete" href="emp/${entity.id}">Delete</a> </td>
                    </tr>
                </c:forEach>

        </table>
    </c:if>

</body>
<script type="text/javascript" src="/jquery-1.10.1.min.js"></script>
<script type="text/javascript">
    $(function () {
        $(".delete").click(function () {

            var href = $(this).attr("href");
            $("form").attr("action",href).submit();
            return false;
        })
    })

</script>
</html>
